/////////
#ifndef GITEE_ENHANCEUTILS_COMMON_HPP
#define GITEE_ENHANCEUTILS_COMMON_HPP
#include "string_view.hpp"
#include <string>

namespace gitee {
// We treat ASCII encoding as UTF-8
enum class encoding_t : uint32_t {
  utf7,
  utf8,
  utf8withbom,
  utf16le,
  utf16be,
  utf32le,
  utf32be,
  binary,
  empty
};
encoding_t DetectBufferEncoding(const unsigned char *buf, size_t len);
bool UnescapeUnicode(gitee::string_view source, bool leave_nulls_escaped,
                     std::string *dest);
std::string EscapeUnicode(gitee::string_view sv);
bool CalculateRepoSize(gitee::string_view dir, int64_t &size);
bool MoveRepoToTrashEx(gitee::string_view root, gitee::string_view trash,
                       gitee::string_view diskpath, std::string &trashdir);
} // namespace gitee

#endif
